package com.lf.web.others;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ZhengGuangGuo on 2017/7/31 22:00.
 */
public class serviceMain {

    public static void main(String[] args) {
        List<parent> parents = new ArrayList<>();
        List<son> sons = new ArrayList<>();

        List<parent> results = new ArrayList<>();

        for (int i= 0; i<2; i++) {
            parent parentobj = new parent();
            parentobj.setName("zhangsan");
            parentobj.setFlag(i);

            parents.add(parentobj);
        }

        for (int i = 0; i<2; i++){
            son sonobj = new son();
            sonobj.setName("lisi");
            sonobj.setAge("4");
            sons.add(sonobj);
        }

        for (int i=0; i<2; i++) {
            if (i%2 == 0) {
                results.add(sons.get(i));
            } else {
                results.add(parents.get(i));
            }
        }
        results.forEach(o-> System.out.println(o.getName()));
    }


}
